import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import Components from 'unplugin-vue-components/vite';
// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    // 自动到入vue和element-plus的api，比如ref, ElMessage.success
    AutoImport({
      imports: ['vue'],
      resolvers: [ElementPlusResolver()],
    }),
    // 自动导入element-plus的组件，不是api
    Components({
      resolvers: [ElementPlusResolver()],
    }),
  ],
  resolve: {
    extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.vue'],
  },
})
